<form method="post" enctype="multipart/form-data" target="_blank" id="form-order">
    <div class="table-responsive">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <td>
                        <a href="javascript:sort('user_id');">ID</a>
                    </td>
                    <td>
                        <a href="javascript:sort('store_name');">商家名称</a>
                    </td>
                    <td>
                        <a href="javascript:sort('phone');">手机号码</a>
                    </td>
                    <td>
                        <a href="javascript:sort('store_img');">商家LOGO</a>
                    </td>
                    <td>
                        <a href="javascript:sort('number');">登录次数</a>
                    </td>
                    <td>
                        <a href="javascript:sort('add_time');">注册日期</a>
                    </td>
                    <td>
                        <a href="javascript:sort('freeze');">状态</a>
                    </td>
                    <td class="text-right">操作</td>
                </tr>
            </thead>
            <tbody>
            <volist name="userList" id="list">
                <tr style="line-height:32px;">
                <td style="line-height:32px;">{$list.id}</td>
                <td style="line-height:32px;">{$list.store_name}</td>
                <td style="line-height:32px;">{$list.phone}</td>
                <td style="line-height:32px;">
                    <if condition="$list['store_img']">
                        <a href="{$list.store_img}" target="_blank">
                            <img width="30" height="30" src="{$list.store_img}" />
                        </a>
                    </if>
                </td>
                <td style="line-height:32px;">{$list.number}</td>
                <td style="line-height:32px;">{$list.add_time|date="Y-m-d H:i:s",###}</td>
                <td style="line-height:32px;"><img width="20" height="20" src="__PUBLIC__/images/<if condition='$list[status] eq 1'>yes.png<else />cancel.png</if>" onclick="changeTableVal('goods_cat', 'id', '{$vo.id}', 'status', this)" /></td>
                <td class="text-right">
                    <a href="{:U('Admin/Business/detail',array('id'=>$list['id']))}" data-toggle="tooltip" title="" class="btn btn-info"><i class="fa fa-pencil"></i></a>
                    <a class="btn btn-danger" onclick="delfunc(this,1)" data-url="{:U('Admin/Business/freeze')}" data-id="{$list['id']}"><if condition="$list['status'] eq 1">冻结<else />解冻</if></a>
                </td>
                </tr>
            </volist>
            </tbody>
        </table>
    </div>
</form>
<div class="row">
    <div class="col-sm-3 text-left"></div>
    <div class="col-sm-9 text-right">{$page}</div>
</div>
<script>
    function delfunc(obj,num) {
		if (confirm('确认冻结吗？')) {
			$.ajax({
				type: 'post',
				url: $(obj).attr('data-url'),
				data: {
					act: 'del',
					id: $(obj).attr('data-id')
				},
				dataType: 'json',
				success: function(data) {
					if (data.code==200) {
						if(data.status==1){
							$(obj).parent().prev().prev().html('正常');
							$(obj).html('冻结');
						}else{
							$(obj).parent().prev().prev().html('<span style="color:red;">冻结</span>');
							$(obj).html('解冻');
						}
					} else {
						layer.alert('冻结失败', {
							icon: 2
						});
					}
				}
			});
		}
	}
    $(".pagination  a").click(function () {
        var page = $(this).data('p');
        ajaxGetTable('search-form2', page);
    });
</script>
